/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.com.mblj.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author markos
 */
@Entity
@Table(name = "tipos_personas")
@NamedQueries({@NamedQuery(name = "TiposPersonas.findAll", query = "SELECT t FROM TiposPersonas t"), @NamedQuery(name = "TiposPersonas.findByTpTipoPersona", query = "SELECT t FROM TiposPersonas t WHERE t.tpTipoPersona = :tpTipoPersona"), @NamedQuery(name = "TiposPersonas.findByTpDescripcion", query = "SELECT t FROM TiposPersonas t WHERE t.tpDescripcion = :tpDescripcion")})
public class TiposPersonas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "tp_tipo_persona")
    private Integer tpTipoPersona;
    @Column(name = "tp_descripcion")
    private String tpDescripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tiposPersonas", fetch = FetchType.LAZY)
    private List<PersonaDenuncia> personaDenunciaList;

    public TiposPersonas() {
    }

    public TiposPersonas(Integer tpTipoPersona) {
        this.tpTipoPersona = tpTipoPersona;
    }

    public Integer getTpTipoPersona() {
        return tpTipoPersona;
    }

    public void setTpTipoPersona(Integer tpTipoPersona) {
        this.tpTipoPersona = tpTipoPersona;
    }

    public String getTpDescripcion() {
        return tpDescripcion;
    }

    public void setTpDescripcion(String tpDescripcion) {
        this.tpDescripcion = tpDescripcion;
    }

    public List<PersonaDenuncia> getPersonaDenunciaList() {
        return personaDenunciaList;
    }

    public void setPersonaDenunciaList(List<PersonaDenuncia> personaDenunciaList) {
        this.personaDenunciaList = personaDenunciaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tpTipoPersona != null ? tpTipoPersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TiposPersonas)) {
            return false;
        }
        TiposPersonas other = (TiposPersonas) object;
        if ((this.tpTipoPersona == null && other.tpTipoPersona != null) || (this.tpTipoPersona != null && !this.tpTipoPersona.equals(other.tpTipoPersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.mblj.domain.TiposPersonas[tpTipoPersona=" + tpTipoPersona + "]";
    }

}
